import React, { Component } from 'react'
import { render } from 'react-dom'
import { Icon, Input, Form, Button } from 'antd'

import './statics/less/app.less'

class FormEx extends Component {
  render() {
    const { form: { getFieldDecorator, validateFields } } = this.props
    return (
      <div>
        {getFieldDecorator('input', {initialValue: 'i'})(
          <Input />
        )}
        <Button
          onClick={() => {
            validateFields((err, fieldsValue) => {
              console.log(fieldsValue)
            })
          }}
        >
          test
        </Button>
      </div>
    )
  }
}

FormEx = Form.create()(FormEx)

class App extends Component {
  render() {
    return (
      <div>App<Icon type="question" /><FormEx /></div>
    )
  }
}

render(
  <App />,
  document.getElementById('app')
)